package com.lyc.day1101.demo4;

/**
 * @author ：Xiaochen
 * @date ：Created in 2022/11/1 19:18
 * @description：
 * @modified By：
 * @version:
 */
public class TestPriority {
    public static void main(String[] args) {
        PriorityDemo t1 = new PriorityDemo("线程A");
        PriorityDemo t2 = new PriorityDemo("线程B");
        PriorityDemo t3 = new PriorityDemo("线程C");

        t1.setPriority(1);
        t2.setPriority(5);
        t3.setPriority(10);

        t1.start();
        t2.start();
        t3.start();
    }
}
class PriorityDemo extends Thread{
    PriorityDemo(String name){
        super(name);
    }

    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println(Thread.currentThread().getName()+"---------------"+i);
        }
    }
}